import { Column, DeleteDateColumn, Entity, PrimaryGeneratedColumn } from "typeorm";

@Entity({ name: "order" })
export class OrderEntity {
  // index
  @PrimaryGeneratedColumn({ type: "int" })
  id: number

  // user id
  @Column({ type: "varchar" })
  uid: string

  // application id
  @Column({ type: "varchar" })
  pid: string

  // order title
  @Column({ type: "varchar" })
  title: string

  // payment amount
  @Column({ type: "float" })
  total: number

  // payment type, 0 is aliPay, 1 is wechatPay
  @Column({ type: "int" })
  type: number

  // payment status
  @Column({ type: "int" })
  status: number

  // order number
  @Column({ type: "varchar" })
  order: string

  // order date
  @Column({ type: "date" })
  create_date: string

  // soft deletion tag
  @DeleteDateColumn({ nullable: true })
  deleteAt: Date
}
